<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>
    <xsl:template match="body">
        <xsl:apply-templates />
    </xsl:template>
    
    <!-- TODO customize transformation rules 
         syntax recommendation http://www.w3.org/TR/xslt 
    -->
    <xsl:template match="ol[@class='code']">
        <script type="text/javascript">
            <xsl:for-each select="li">
                <xsl:value-of select="."/>
            </xsl:for-each>
        </script>
    </xsl:template>
    
    <xsl:template match="ol[@class='code']/*/ol">
        <script type="text/javascript">
            <xsl:for-each select="li">
                <xsl:value-of select="."/>
            </xsl:for-each>
        </script>
    </xsl:template>
    
    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>
</xsl:stylesheet>